package com.itheima.singleinstance;

public class Test {
    public static void main(String[] args) {
        //目标:设计单例类
        A a1=A.getInstance();
        A a2 =A.getInstance();
        System.out.println(a2 ==a2);    //产生的对象是同一个

        System.out.println("----------------------------------");

        B b1=B.getInstance();
        B b2 =B.getInstance();
        System.out.println(b1 == b2);
    }
}
